package com.yxhl.zoume.utils;

import android.graphics.drawable.BitmapDrawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.PopupWindow;

import com.yxhl.zoume.R;

/**
 * Created by sugarya on 16/4/25.
 */
public class PopupWindowUtils {


    public static PopupWindow getSchedulePhonePopupWindow(View contentView) {
        return getPopupWindow(
                contentView,
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT,
                R.style.AnimationPopupWindow,
                false
        );

    }

    private static PopupWindow getPopupWindow(View contentView, int width, int height,
                                              int animationStyle, boolean outsideTouchable) {
        PopupWindow popupWindow = new PopupWindow(
                contentView,
                width,
                height,
                true
        );
        popupWindow.setOutsideTouchable(outsideTouchable);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setAnimationStyle(animationStyle);

        return popupWindow;
    }
}
